// JointFormatManager.h: interface for the JointFormatManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_JOINTFORMATMANAGER_H__9FA8CF77_8473_48C0_BB8D_3C72A875B7D3__INCLUDED_)
#define AFX_JOINTFORMATMANAGER_H__9FA8CF77_8473_48C0_BB8D_3C72A875B7D3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "JointFormat.h"
#include <afxtempl.h>

namespace JointSystem
{

class JointFormatManager  
{
private:
	JointFormatManager();

public:
	~JointFormatManager();

private:
	static JointFormatManager* g_Instance;

public:
	static JointFormatManager* Instance(); /*{
		if ( g_Instance == 0 )
			g_Instance = new JointFormatManager;
		return g_Instance;
	}*/
	static void DeleteInstance() {
/*		if ( g_Instance ) {
			delete g_Instance;
			g_Instance = 0;
		}*/
	}

public:
	JointFormat* GetJointFormat( const CString& matchingJFormat, const CString& matchedJFormat );
	BOOL HasRegistered( const CString& matchingJFormat, const CString& matchedJFormat );
	VOID Register( JointFormat* aJFormat );

private:
	VOID UnregisterAll();
	BOOL HasRegistered( JointFormat* aJFormat );
	INT GetItemIndex( const CString& matchingJFormat, const CString& matchedJFormat ) CONST;

private:
	typedef CArray<JointFormat*,JointFormat*> CJointFormatPtrArray;
	CJointFormatPtrArray m_JointFormats;
};
};
#endif // !defined(AFX_JOINTFORMATMANAGER_H__9FA8CF77_8473_48C0_BB8D_3C72A875B7D3__INCLUDED_)
